package com.nix.model.page.line;

import com.nix.model.page.cursor.NXParagraphCursor;
import com.nix.model.page.style.NXStyle;

public class NXLine {
	

	private NXParagraphCursor paragraphCursor;
	private int RealStartCharIndex;
	private int EndElementIndex;
	private int EndStartCharIndex;

	

	private int StartElementIndex;
	private int paragraphLength;
	private NXStyle nxStyle;
	
	
	private int width;
	private int height;
	private int descent;
	
	private boolean isVisiable;







	public NXLine(NXParagraphCursor paragraphCursor,int startElementIndex,int realStartCharIndex,NXStyle nxStyle){
		
		//TODO
		this.paragraphCursor = paragraphCursor;
		this.StartElementIndex = startElementIndex;
		this.RealStartCharIndex = realStartCharIndex;
		
		this.paragraphLength = paragraphCursor.Length;
		
		this.nxStyle = nxStyle;
	}
	

	
	
	
	public int getEndStartCharIndex() {
		return EndStartCharIndex;
	}

	public void setEndStartCharIndex(int endStartCharIndex) {
		EndStartCharIndex = endStartCharIndex;
	}
	
	public int getParagraphLength() {
		return paragraphLength;
	}

	public void setParagraphLength(int paragraphLength) {
		this.paragraphLength = paragraphLength;
	}
	
	public boolean isVisiable() {
		return isVisiable;
	}

	public void setVisiable(boolean isVisiable) {
		this.isVisiable = isVisiable;
	}
	
	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getDescent() {
		return descent;
	}


	public void setDescent(int descent) {
		this.descent = descent;
	}

	
	public int getRealStartCharIndex() {
		return RealStartCharIndex;
	}

	public void setRealStartCharIndex(int realStartCharIndex) {
		RealStartCharIndex = realStartCharIndex;
	}

	public int getEndElementIndex() {
		return EndElementIndex;
	}

	public void setEndElementIndex(int endElementIndex) {
		EndElementIndex = endElementIndex;
	}

	public NXParagraphCursor getParagraphCursor() {
		return paragraphCursor;
	}

	public void setParagraphCursor(NXParagraphCursor paragraphCursor) {
		this.paragraphCursor = paragraphCursor;
	}
	
	
	@Override
	public String toString() {
		return getLineKey();
	}
	
	private String getLineKey(){
		return paragraphCursor.Index + "_" + 
			StartElementIndex + "_" + EndElementIndex + "_" + RealStartCharIndex + "_" + nxStyle;
		
	}
	
}
